package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName service_ticket
 */
@TableName(value ="service_ticket")
@Data
public class ServiceTicket {
    /**
     * 
     */
    @TableId(value = "ticket_id", type = IdType.AUTO)
    private Integer ticketId;

    /**
     * 工单编号
     */
    @TableField(value = "ticket_number")
    private String ticketNumber;

    /**
     * 服务类型
     */
    @TableField(value = "type_id")
    private Integer typeId;

    /**
     * 请求人ID
     */
    @TableField(value = "requester_id")
    private Integer requesterId;

    /**
     * 关联老人ID
     */
    @TableField(value = "elderly_id")
    private Integer elderlyId;

    /**
     * 关联设备ID
     */
    @TableField(value = "device_id")
    private Integer deviceId;

    /**
     * 请求时间
     */
    @TableField(value = "request_time")
    private Date requestTime;

    /**
     * 期望完成时间
     */
    @TableField(value = "expected_time")
    private Date expectedTime;

    /**
     * 优先级
     */
    @TableField(value = "priority")
    private Object priority;

    /**
     * 处理人ID
     */
    @TableField(value = "assignee_id")
    private Integer assigneeId;

    /**
     * 分配时间
     */
    @TableField(value = "assign_time")
    private Date assignTime;

    /**
     * 工单状态
     */
    @TableField(value = "status")
    private Object status;

    /**
     * 完成时间
     */
    @TableField(value = "completion_time")
    private Date completionTime;

    /**
     * 评价分数(1-5)
     */
    @TableField(value = "evaluation_score")
    private Integer evaluationScore;

    /**
     * 评价内容
     */
    @TableField(value = "evaluation_content")
    private String evaluationContent;

    /**
     * 备注
     */
    @TableField(value = "remarks")
    private String remarks;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ServiceTicket other = (ServiceTicket) that;
        return (this.getTicketId() == null ? other.getTicketId() == null : this.getTicketId().equals(other.getTicketId()))
            && (this.getTicketNumber() == null ? other.getTicketNumber() == null : this.getTicketNumber().equals(other.getTicketNumber()))
            && (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId()))
            && (this.getRequesterId() == null ? other.getRequesterId() == null : this.getRequesterId().equals(other.getRequesterId()))
            && (this.getElderlyId() == null ? other.getElderlyId() == null : this.getElderlyId().equals(other.getElderlyId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getRequestTime() == null ? other.getRequestTime() == null : this.getRequestTime().equals(other.getRequestTime()))
            && (this.getExpectedTime() == null ? other.getExpectedTime() == null : this.getExpectedTime().equals(other.getExpectedTime()))
            && (this.getPriority() == null ? other.getPriority() == null : this.getPriority().equals(other.getPriority()))
            && (this.getAssigneeId() == null ? other.getAssigneeId() == null : this.getAssigneeId().equals(other.getAssigneeId()))
            && (this.getAssignTime() == null ? other.getAssignTime() == null : this.getAssignTime().equals(other.getAssignTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCompletionTime() == null ? other.getCompletionTime() == null : this.getCompletionTime().equals(other.getCompletionTime()))
            && (this.getEvaluationScore() == null ? other.getEvaluationScore() == null : this.getEvaluationScore().equals(other.getEvaluationScore()))
            && (this.getEvaluationContent() == null ? other.getEvaluationContent() == null : this.getEvaluationContent().equals(other.getEvaluationContent()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTicketId() == null) ? 0 : getTicketId().hashCode());
        result = prime * result + ((getTicketNumber() == null) ? 0 : getTicketNumber().hashCode());
        result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode());
        result = prime * result + ((getRequesterId() == null) ? 0 : getRequesterId().hashCode());
        result = prime * result + ((getElderlyId() == null) ? 0 : getElderlyId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getRequestTime() == null) ? 0 : getRequestTime().hashCode());
        result = prime * result + ((getExpectedTime() == null) ? 0 : getExpectedTime().hashCode());
        result = prime * result + ((getPriority() == null) ? 0 : getPriority().hashCode());
        result = prime * result + ((getAssigneeId() == null) ? 0 : getAssigneeId().hashCode());
        result = prime * result + ((getAssignTime() == null) ? 0 : getAssignTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCompletionTime() == null) ? 0 : getCompletionTime().hashCode());
        result = prime * result + ((getEvaluationScore() == null) ? 0 : getEvaluationScore().hashCode());
        result = prime * result + ((getEvaluationContent() == null) ? 0 : getEvaluationContent().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", ticketId=").append(ticketId);
        sb.append(", ticketNumber=").append(ticketNumber);
        sb.append(", typeId=").append(typeId);
        sb.append(", requesterId=").append(requesterId);
        sb.append(", elderlyId=").append(elderlyId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", requestTime=").append(requestTime);
        sb.append(", expectedTime=").append(expectedTime);
        sb.append(", priority=").append(priority);
        sb.append(", assigneeId=").append(assigneeId);
        sb.append(", assignTime=").append(assignTime);
        sb.append(", status=").append(status);
        sb.append(", completionTime=").append(completionTime);
        sb.append(", evaluationScore=").append(evaluationScore);
        sb.append(", evaluationContent=").append(evaluationContent);
        sb.append(", remarks=").append(remarks);
        sb.append("]");
        return sb.toString();
    }
}